/**
 * @name Include Dependencies
 * @kind problem
 * @problem.severity info
 * @description Extracts all include statements and their dependencies
 * @id cpp/include-dependencies
 */

import cpp

from Include include, File file
where include.getFile() = file
  // 排除系统头文件
  and not include.getIncludedFile().getRelativePath().matches("%/usr/%")
  and not include.getIncludedFile().getRelativePath().matches("%stdlib.h%")
  and not include.getIncludedFile().getRelativePath().matches("%string.h%")
select
  file.getRelativePath() as filePath,
  include.getLocation().getStartLine() as line,
  include.getLocation().getStartColumn() as column,
  include.getIncludedFile().getRelativePath() as includePath,
  include.getDirective().getText() as includeStatement

